<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>文章编辑</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <style>
        body{
            background-color: #f3f3f3;
        }
        .mainbox{
            height: auto;
            background-color: #fff;
            padding: 30px 20px;
            margin-top: 30px;
        }
        .layui-upload-list img{
        	width: auto;
		    height: 92px;
		    margin: 0 18px 10px 18px;
        }
        .inline-flex-center {
		    display: inline-flex;
		    align-items: center;
		    justify-content: center;
		}
    </style>
</head>
<body >
    <!-- 导入顶部导航---start -->
	<%@ include file="head.jsp" %>
	<!-- 导入顶部导航---end -->
	
    <div class="layui-container">
        <div class="mainbox">
                <form class="layui-form" action="addatricle.action" lay-filter="example">
                	<input type="hidden" name="artsid" id="artsid" value="${article.artsid}">
                	<input type="hidden" id="stuinfoid" name="stuinfoid" value="${loginuser.stuinfoid}">
                        <div class="layui-form-item">
                          <label class="layui-form-label">文章标题</label>
                          <div class="layui-input-block">
                          	
                            <input type="text" id="arttitle" name="arttitle" lay-verify="title" autocomplete="off" placeholder="请输入标题" value="${article.arttitle }" class="layui-input">
                          </div>
                        </div>
                        
						<div class="layui-upload inline-flex-center">
			            	<input type="hidden" name="account" id="account" value="${loginuser.account }">
			            	<input type="hidden" name="photoname" id="photoname" value="${article.grade }">
			                <button type="button" class="layui-btn upselfhead-btn" style="background:#3AACDA;"
			                    id="grzpup">上传封面</button>
			                <div class="layui-upload-list">
			                    <img class="layui-upload-img upselfhead" id="demo1">
			                </div>
			                <p id="demoText" style="margin:0;"></p>
		            	</div>                        
                        
                        <div class="layui-form-item editarea">
                                <label class="layui-form-label">文章内容</label>
                                <div class="layui-input-block">
                                    <textarea id="editcontent" name="artcontant" style="display: none;">${article.artcontant}</textarea>
                                </div>
                        </div>
                       
                        <div class="layui-form-item">
                          <div class="layui-input-block">
                            <button class="layui-btn" type="submit" lay-filter="publish">发表</button>
                          </div>
                        </div>
                      </form>
               
        </div>
            
    </div>
    
    <!-- 导入网页页脚---start -->
	<%@ include file="foot.jsp" %>
	<!-- 导入网页页脚---end -->
	
    <script src="layui/layui.js"></script>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/my.js"></script>
    <script>
        
        layui.use('layedit', function(){
          var layedit = layui.layedit;
          //图片上传全局接口
          layedit.set({
  			  uploadImage: {
    		  url: 'editfileuploadservlet.do?path=' + $("#account").val() //接口url  		  
    		  ,type: '', //默认post
  			  }
		  });

          layedit.build('editcontent', {
            height: 550 //设置编辑器高度
            });
        });
     

        </script>
</body>
</html>